#include<stdio.h>

int main(){
	int s,a;
	scanf("%d",&s);
	a=s-3500;
	if(a<=0) printf("%d",s);
	else if(a<=1500) printf("%.0f",3500+a*0.97);
	else if(a<=4500) printf("%.0f",3500+1500*0.97+(a-1500)*0.9);
	else if(a<=9000) printf("%.0f",3500+1500*0.97+3000*0.9+(a-4500)*0.8);
	else if(a<=35000) printf("%.0f",3500+1500*0.97+3000*0.9+4500*0.8+(a-9000)*0.75);
	else printf("%.0f",3500+1500*0.97+3000*0.9+4500*0.8+26000*0.75+(a-35000)*0.7);
	return 0;
}
